import {baseRequest} from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/port-pool/` + url, ...arg)


export default {
	async fetchList(query) {
		return await request('page', query, 'get')
	},
	async portPoolList() {
		return await request('list', null, 'get')
	},
	async availablePortList(query) {
		return await request('get-available-port-list', query, 'get')
	},
	async updateEnableStatus(id, enable) {
		return await request('update/enable-status', {
			id: id,
			enable: enable
		}, 'post')
	},
	async createPortPool(data) {
		return await request('create', data, 'post')
	},
	async updatePortPool(data) {
		return await request('update', data, 'post')
	},
	async deletePortPool(id) {
		return await request('delete', {
			id: id
		}, 'post')
	},
	async deleteBatchPortPool(ids) {
		return await request('delete-batch',  {
			ids: ids
		}, 'post')
	},
	async portAvailable(query) {
		return await request('port-available',  query, 'get')
	},
}
